<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .target {
            width: 200px;
            height: 200px;
            border: 1px solid black;
            font-size: 30px;
            text-align: center;
            line-height: 200px;
        }
    </style>
</head>

<body>
    <div class="box">hello!</div>
    <script>
        var box = document.querySelector('.box')
        box.className = 'target'
    </script>
</body>
</html>